/*
 * @Author: yehongbo 1394168736@qq.com
 * @Date: 2024-06-04 20:14:40
 * @LastEditors: yehongbo 1394168736@qq.com
 * @LastEditTime: 2024-06-04 20:20:20
 * @FilePath: \myWorkspace\react-basic\src\components\zuxian\parent.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

// 类组件
import { Component } from 'react'
import Child1 from './child1.jsx'
import Child2 from './child2.jsx'
import { Provider } from '@/provider.js'

export default class parent extends Component {

    state = { // 这样写相当于在constructor中写this.state
        msg: 'parent msg'
    }

    render() {
        return (
            <Provider value={this.state.msg}>
                <div>
                    <h2>父组件</h2>
                    <Child2 />
                </div >
            </Provider>
        )
    }
}